# 1、下列程序结果是__初始化、类A、销毁____.
# class A:
#
#     def __init__(self):
#         print("初始化")
#
#     def __del__(self):
#         print("销毁")
#
#     def __str__(self):
#         return "类A"
# a = A()
# print(a)

#  2. 下列程序执行结果___动物在叫、汪汪汪___.
# class Animal(object):
#
#     def shut(self):
#         print("动物在叫")
# class Dog(Animal):
#
#     def shut(self):
#         super().shut()
#         print("汪汪汪")
# dog = Dog()
# dog.shut()

# 3. 创建猫类：
# 	类名：Cat
# 	属性：无
# 描述：创建一个Cat类，通过Cat类创建一个对象cat，执行print(cat)输出“喵？喵？喵？”.
# class Cat(object):
#     def __init__(self,name):
#         self.name =name
#
#     def __str__(self):
#         return "喵？喵？喵"
#
#
# cat = Cat("a")
# print(cat)

# 4.创建计算器类：
# 	类名：Calculator
# 	属性：number_1（数字一）、number_2（数字二）
# 方法：
# 	def __init__(self,number_1,number_2):
# # 类的初始化方法
# 	def add(self) # 返回数字一加数字二的值
# 	def sub(self) # 返回数字一减去数字二的值
# 	def div(self) # 返回数字一除以数字二的值
# 	def mul(self) # 返回数字一乘以数字二的值
# 描述：创建计算器类，通过计算器类创建一个计算器对象，在创建对象时需要传入数字一和数字二，分别调用计算器的四种方法.
# class Calculator():
#     def __init__(self, number_1, number_2):
#         self.number_1 = number_1
#         self.number_2 = number_2
#
#     def add(self):
#         print(self.number_1 + self.number_2)
#
#     def sub(self):
#         print(self.number_1 - self.number_2)
#
#     def div(self):
#         print(self.number_1 / self.number_2)
#
#     def mul(self):
#         print(self.number_1 * self.number_2)
#
#
# num = Calculator(1, 2)
# num.add()
# num.sub()
# num.div()
# num.mul()

# 5.创建Cat和Dog类分别继承Animal类，分别重写shut和eat方法，创建Cat类对象cat和Dog类对象dog，分别调用cat和dog的shut和eat方法
# class Animal:
#
#     def shut(self):
# 		# 打印叫声
#         pass
#
#     def eat(self):
# 		# 打印爱吃的食物
#         pass
# class Animal:
#     def __init__(self, name, say, food):
#         self.name = name
#         self.say = say
#         self.food = food
#
#     def shut(self):
#         print("叫声是 %s" % self.say)
#         pass
#
#     def eat(self):
#         print("食物是 %s" % self.food)
#         pass
#
#
# class Cat(Animal):
#     def shut(self):
#         print("%s 叫声是 %s" % (self.name, self.say))
#         pass
#
#     def eat(self):
#         print("%s 爱吃的食物是 %s" % (self.name, self.food))
#         pass
#
#
# class Dog(Animal):
#     def shut(self):
#         print("%s的叫声是: %s" % (self.name, self.say))
#         pass
#
#     def eat(self):
#         print("%s的食物是：%s" % (self.name, self.food))
#         pass
#
#
# cat = Cat("小奶猫", "喵呜", "小鱼干")
# dog = Dog("奶狗", "汪汪", "骨头")
# cat.shut()
# cat.eat()
# dog.shut()
# dog.eat()

# 1、	面向对象三大特性是__封装____、___继承___、___多态___.
# 2、	单例模式创建保证实例只创建______次.
#
